package drds.global_transaction.transaction_coordinator.transaction_session;

import drds.global_transaction.api.api.BranchTransactionStatus;
import drds.global_transaction.api.api.GlobalTransactionStatus;
import drds.global_transaction.api.exception.GlobalTransactionException;

public interface IGlobalTransactionSessionLifecycle
{

	void addBranchTransactionSession(BranchTransactionSession branchTransactionSession) throws GlobalTransactionException;

	void begin() throws GlobalTransactionException;

	void changeBranchTransactionStatus(BranchTransactionSession branchTransactionSession, BranchTransactionStatus branchTransactionStatus) throws GlobalTransactionException;

	void changeGlobalTransactionStatus(GlobalTransactionStatus globalTransactionStatus) throws GlobalTransactionException;

	void close() throws GlobalTransactionException;

	void end() throws GlobalTransactionException;

	boolean isActive();

	void unlockAndRemoveBranchTransactionSession(BranchTransactionSession branchTransactionSession) throws GlobalTransactionException;
}
